﻿<%@ Control Language="C#" Inherits="Yuanlin.Business.FriendLinkEditControl, Yuanlin.Business" AutoEventWireup="true" %>
<script type="text/javascript">
<!--
    function CheckValue()
    {
        var select = document.getElementById('<%= categoryDropDownList.ClientID %>');
        var hasSelected = false;
        for(var i = 0; i < select.length; i++)
        {   
            if(select[i].selected)
            {
                hasSelected = true;
                break;
            }   
        }   
        if(hasSelected == false)
        {   
            alert('请选择类别！');
            select.focus();
            return false;
        }
        
        var title = document.getElementById('<%= titleValuedTextBox.ClientID %>');
        if(title.value.Trim().length==0)
        {
            alert('请填写名称！');
            title.focus();
            return false;
        }
        
        title = document.getElementById('<%= linkUrlValuedTextBox.ClientID %>');
        if(title.value.Trim().length==0)
        {
            alert('请填写地址！');
            title.focus();
            return false;
        }
        if(!isURL(title.value.Trim()))
        {
            alert('请正确填写地址！格式如：http://www.xxx.com');
            title.focus();
            return false;
        }
        return true;
    }
//-->
</script>
<div class="AdminArea">
    <fieldset>
        <legend><nwap:ResourceLiteral runat="server" ResourceName="System_Applications_Yuanlin_EditFriendLink" ResourceFile="ControlPanelResources.xml"></nwap:ResourceLiteral></legend>
		
		<div class="FormRow">
            <div class="LargerFieldNameRequireCharacter">
                <nwap:ResourceLabel runat="Server" CssClass="RedColor" ResourceFile="ControlPanelResources.xml" ResourceName="RequireCharacter" />
                <nwap:ResourceLabel runat="Server" ControlToLabel="categoryDropDownList" ResourceFile="ControlPanelResources.xml" ResourceName="System_Applications_Yuanlin_FriendLink_Category" />
            </div>
            <nwap:ValuedDropDownList Runat="server" CssClass="InputField SmallWidth" id="categoryDropDownList" />&nbsp;&nbsp;
        </div>
        
        <div class="FormRow">
            <div class="LargerFieldNameRequireCharacter">
                <nwap:ResourceLabel runat="Server" CssClass="RedColor" ResourceFile="ControlPanelResources.xml" ResourceName="RequireCharacter" />
                <nwap:ResourceLabel runat="Server" ControlToLabel="titleValuedTextBox" ResourceFile="ControlPanelResources.xml" ResourceName="System_Applications_Yuanlin_FriendLink_Title" />
            </div>
            <nwap:ValuedTextBox Runat="server" CssClass="InputField MiddleWidth" id="titleValuedTextBox" />
        </div>
        <div class="FormRow">
             <div class="LargerFieldNameRequireCharacter">
                <nwap:ResourceLabel runat="Server" CssClass="RedColor" ResourceFile="ControlPanelResources.xml" ResourceName="RequireCharacter" />
                <nwap:ResourceLabel runat="Server" ControlToLabel="linkUrlValuedTextBox" ResourceFile="ControlPanelResources.xml" ResourceName="System_Applications_Yuanlin_FriendLink_LinkUrl" />
            </div>
            <nwap:ValuedTextBox Runat="server" CssClass="InputField MiddleWidth" id="linkUrlValuedTextBox" />
        </div>


        <div class="FormRow SubmitButtonRow">
            <nwap:Resourcebutton id="SaveButton" ResourceName="Save" CssClass="Button" Runat="server" OnClientClick="return CheckValue()"></nwap:Resourcebutton>&nbsp;&nbsp;&nbsp;&nbsp;
            <nwap:Resourcebutton id="BackButton" ResourceName="Back" CssClass="Button" Runat="server"></nwap:Resourcebutton>
        </div>	
    </fieldset>
</div> 